/** form **********************************************************************/
export class RoleForm {
    public roleId?: string;
    public code!: string;
    public name!: string;
    public description!: string;
    public orderIndex!: number;

    public static rules = {
        code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    };
}

/** query *********************************************************************/
export class RoleQuery {
    public code!: string;
    public name!: string;
}

/** dto ***********************************************************************/
export class RoleListDTO {
    public roleId!: string;
    public code!: string;
    public name!: string;
    public description!: string;
    public orderIndex!: number;
    public preset!: boolean;

    public static columns = [
        {
            title: '编码',
            dataIndex: 'code',
            width: 100,
        },
        {
            title: '名称',
            dataIndex: 'name',
            width: 200,
        },
        {
            title: '顺序',
            dataIndex: 'orderIndex',
            align: 'center',
            width: 60,
        },
        {
            title: '描述',
            dataIndex: 'description',
        },
        {
            title: '操作',
            dataIndex: 'action',
            width: 200,
            fixed: 'right',
        },
    ];
}

export class RoleDTO extends RoleListDTO {}
